package HomeWork.Extends_06;

public class FeedMan {
    public void feedAnimals(Animal animal){
        if (animal instanceof Dog dog){
            dog.eat();
        }
        if (animal instanceof Ghost ghost) {
            ghost.eat();
        }
        if (animal instanceof Frog frog){
            frog.eat();
        }
    }
}
